package leecode

import "fmt"

func MissingNumber(nums []int) int {
	end := len(nums) //尾数
	fmt.Println(end)
	rightSum := (1 + end) * len(nums) / 2
	var errSum int
	for i := 0; i < len(nums); i++ {
		errSum += nums[i]
	}
	return rightSum - errSum
}
